ENV Assembler
Quick Guide

ENV Assembler is an assembler for IA-32 programs. It uses Intel syntax and supports linking. It is only available for ENV-ROD operating system.

Registers
ENV Assembler supports most of x86 registers, there are:
	al	ah	eax
	bl	bh	ebx
	cl	ch	ecx
	dl	dh	edx
	si
	di
	bp	ebp
	sp	esp

Instructions
ENV Assembler supports these instructions:
	mov	add	sub	mul
	div	or	xor	and
	shl	shr	xchg	in
	out	push	pop	lodsb
	stosb	hlt	cmp	call
	jmp	je	jne	jg
	jge	jl	jle	int
	ret	iret	clc	stc
	cli	sti	lgdt	lidt
	sgdt	sidt	lldt	ltr
	sldt	str

Values
ENV Assembler supports these value formats:
	123		Decimal
	0x1a		Hexadecimal
	'A'		ASCII character
	"ABC"		ASCII string
	$		Current location

Pointers
Declaring pointers in ENV Assembler is same and simple:
	test:
	abc:

Comments
Declaring comments in ENV Assembler is like this:
	; This is a comment
	; This is another comment

Defining Bytes
Defining bytes in ENV Assembler is like this:
	db 123		Defines byte (8-bit)
	dw 1234	Defines word (16-bit)
	dd 123456	Defines double word (32-bit)

You can also fill bytes like this:
	db 0!8		Defines byte 0x00 with 8 times

Indexing
Indexing in ENV Assembler is like this (must be lowercase):
	byte[variable]
	word[variable]
	dword[variable]

You can also index with registers. Registers "bx", "ebx", "esi", and "ebp" are supported.

Origin
If your program begins at specific location, you need to use "org" directive:
	; If program begins at 0x7c00
	org 0x7c00

Example code
	org 0x7c00
	
	mov ah, 14
	mov al, 'H'
	int 0x10
	mov ah, 14
	mov al, 'i'
	int 0x10
	jmp $
	
	db 0!510-$
	dw 0xaa55


Copyright (c) 1981 ENV. All rights reserved.

